/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test;

import java.util.ArrayList;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

/**
 *
 * @author jzajaczek
 */
@ManagedBean
@ViewScoped
public class testBean {

    /**
     * Creates a new instance of testBean
     */
    public testBean() {
    }
    
    public ArrayList<klasaBean> al;
    
    private klasaBean kb;
    
    private int x = 0;
    
    public void one() {
        x = getX() + 1;
    }

    public int getX() {
        return x;
    }
    
    public void setKlasaBean() {
        x = x + 1;
        kb = new klasaBean();
        al.add(x, kb);
    }   
    
    public klasaBean getKlasaBean(int i) {
        return al.get(i);
    }
}